package com.aptech.interceptor;

import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class LoginInterceptor extends AbstractInterceptor{

	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		ActionContext contest=ActionContext.getContext();
		
		Map<String,Object> session=contest.getSession();
		
		if(session.containsKey("login"))
		{
			arg0.invoke();
		}
		return "error";
	}

}
